1. Field of the Invention
The present invention relates to a figure processing apparatus which vectorizes a figure included in a raster image, a method, and a program.
2. Description of the Related Art
A method for recognizing a figure included in a raster image and generating electronic data of the image so that it can be processed by a computer is being proposed.
Japanese Patent Registration 3183690 discusses a method for generating a neatly-arranged flowchart from a hand-drawn flowchart image. In generating such a flowchart, raster image data of a hand-drawn image is vectorized. Then, the shape of the flowchart symbol, such as a circle, rectangle, or rhombus, included in the vector data is recognized, and the format of the data is converted into a format appropriate for the recognized flowchart symbol.
Further, Japanese Patent Application Laid-Open No. 06-337929 discusses a method for implementing correction processing when a raster figure is converted into a vector figure. The figure is classified according to its type, and the content and the order of the correction processing is changed according to the result of the classification. For example, if the figure is made of straight lines, processing such as connecting the neighboring lines, correcting the straight lines, and deleting an extremely small figure is performed after the vectorization. Further, if the figure is made of a curved line, processing such as neighboring line connection and extremely small figure deletion is performed after the vectorization.
Further, Japanese Patent Registration 4185858 discusses a method for dividing a raster image, which is obtained by scanning, into blocks according to its attribute. After then, vectorization of each block is performed. Regarding a region where a great amount of data is necessary due to vectorization, image data of such a region is stored instead of the vector data.
In the description below, a figure having a predetermined shape such as a circle, rectangle, rhombus, triangle, etc. is called a predefined figure and a figure (line drawing) freely drawn by a user is referred to as a free-form figure. For example, Microsoft Office® has a function called “AutoShape”. According to AutoShape, a figure of a predetermined shape (i.e., predefined figure in the present invention) is prepared, and the user can create a drawing by using the predetermined shape.
On the other hand, in some cases, a figure other than a single predefined figure, a single figure made of straight lines, or a single free-form figure is included in a common business document. For example, in some cases, the user creates a composite figure by combining a free-form figure and a predefined figure. However, if the figure is not neatly formed, in spite of the user's intention, there may be a space between the free-form figure and the predefined figure. When a document including such figures is printed on paper, the figures are printed with a space in between.
Further, if this printed document is scanned, since there is a space between the figures, the figures are recognized as different objects. In other words, in spite of the user's intention, the objects are recognized as different objects. Thus, if the user desires to form one object from such objects, the user that performs the scanning needs to manually correct them, which is burdensome.